package com.alibaba.controller;

import com.alibaba.domain.User;
import com.alibaba.feign.UserFeign;

import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

//支付服务的controller
@RestController
public class PayController{

    @Resource
    private UserFeign userFeign;

    //浏览器来掉
    @GetMapping ( "/getUserById/{id}")
    public User getUserById(@PathVariable("id")Long id){
        //使用Feign调用用户服务获取User
        return userFeign.getUserById(id);
    }
}